const http = require('http');
const fs = require('fs'); 

http.createServer(function (request, response) {
  response.writeHead(200, { 'Content-Type': 'text/plain' });

 
  fs.readFile('one.txt', 'utf8', (err, data) => { 
        if (err) {
      response.write('读取文件时发生错误: ' + err);
    } else {
      response.write(data); 
    }
    response.end(); 
  });

}).listen(8000, '127.0.0.1');

console.log('Server running on port 8000.');
